import request from '@/utils/request'

export function fetchDicts(params) {
  return request({
    url: '/api/v1/dicts',
    method: 'get',
    params
  })
}

export function addDict(data) {
  return request({
    url: '/api/v1/dicts',
    method: 'post',
    data
  })
}

export function updateDict(id, data) {
  return request({
    url: `/api/v1/dicts/${id}`,
    method: 'put',
    data
  })
}

export function deleteDict(id) {
  return request({
    url: `/api/v1/dicts/${id}`,
    method: 'delete'
  })
}
